load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "perfschema",
    srcs = [
        "const.go",
        "init.go",
        "tables.go",
    ],
    importpath = "github.com/pingcap/tidb/pkg/infoschema/perfschema",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/ddl",
        "//pkg/expression",
        "//pkg/infoschema",
        "//pkg/kv",
        "//pkg/meta/autoid",
        "//pkg/meta/model",
        "//pkg/parser",
        "//pkg/parser/ast",
        "//pkg/parser/mysql",
        "//pkg/parser/terror",
        "//pkg/sessionctx",
        "//pkg/table",
        "//pkg/table/tables",
        "//pkg/types",
        "//pkg/util",
        "//pkg/util/profile",
        "@com_github_ngaut_pools//:pools",
        "@com_github_pingcap_errors//:errors",
        "@com_github_pingcap_failpoint//:failpoint",
        "@com_github_tikv_pd_client//http",
    ],
)

go_test(
    name = "perfschema_test",
    timeout = "short",
    srcs = [
        "main_test.go",
        "tables_test.go",
    ],
    data = glob(["testdata/**"]),
    embed = [":perfschema"],
    flaky = True,
    shard_count = 5,
    deps = [
        "//pkg/kv",
        "//pkg/parser/terror",
        "//pkg/session",
        "//pkg/store/mockstore",
        "//pkg/testkit",
        "//pkg/testkit/testsetup",
        "@com_github_pingcap_failpoint//:failpoint",
        "@com_github_stretchr_testify//require",
        "@com_github_tikv_pd_client//http",
        "@io_opencensus_go//stats/view",
        "@org_uber_go_goleak//:goleak",
    ],
)
